﻿@using INNOVACALL.Framework.Common
@using InnovaApp.Layers.ResourcesLayer.Properties
@using InnovaApp.Portals.MVC4Portal.Controllers
@{
    Layout = "_LayoutSiteCommon.cshtml";
    string StyleBundleBase = string.Empty;
    InnovaApp.Layers.CommonLayer.Models.ViewModels.LayoutViewModels._LayoutViewModels_Base layoutModel =
        (InnovaApp.Layers.CommonLayer.Models.ViewModels.LayoutViewModels._LayoutViewModels_Base)Model;

    string adminModeCSSClass = (layoutModel._AdminMode ? "adminMode" : "");

    string cssResizableBlocks = string.Empty;

    //toTransfert
    int sp_Layout_ContentBodyPaddingBottom = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_ContentBodyPaddingBottom]);
    int sp_Layout_ContentBodyPaddingLeft = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_ContentBodyPaddingLeft]);
    int sp_Layout_ContentBodyPaddingRight = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_ContentBodyPaddingRight]);
    int sp_Layout_ContentBodyPaddingTop = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_ContentBodyPaddingTop]);
    int sp_Layout_ContentRealHeight = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_ContentRealHeight]);
    
    int sp_Layout_ContentHeight = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_ContentHeight]);
    string sp_Layout_ContentHeightMode = PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_ContentHeightMode];

    bool sp_Layout_DisplayFooter = bool.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_DisplayFooter]);
    bool sp_Layout_DisplayMenu = bool.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_DisplayMenu]);
    bool sp_Layout_DisplayPostMenu = bool.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_DisplayPostMenu]);
    bool sp_Layout_DisplayPreMenu = bool.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_DisplayPreMenu]);

    int sp_Layout_FooterHeight = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_FooterHeight]);
    int sp_Layout_MainContainerWidth = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_MainContainerWidth]);
    int sp_Layout_MenuHeight = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_MenuHeight]);
    int sp_Layout_PostMenuHeight = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_PostMenuHeight]);
    int sp_Layout_PreMenuHeight = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_PreMenuHeight]);
    int sp_Layout_SiteTopMargin = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuTop_SiteTopMargin]);

    cssResizableBlocks = string.Format(
@"
        
        #MyPrettyCMSMainContainer {{
            width:{0}px;
        }}
        #MyPrettyCMSPreMenu {{
            width:{0}px;
            height:{1}px;
        }}
        #MyPrettyCMSMenu {{
            width:{0}px;
            height:{2}px;
        }}
        #MyPrettyCMSPostMenu {{
            width:{0}px;
            height:{3}px;
        }}
        #MyPrettyCMSContent {{
            {4}:{5}px;
            width:{11}px;
            padding-top:{6}px;
            padding-right:{7}px;
            padding-bottom:{8}px;
            padding-left:{9}px;
        }}
        #MyPrettyCMSFooter {{
            width:{0}px;
            height:{10}px;
        }}
"
, sp_Layout_MainContainerWidth
, sp_Layout_PreMenuHeight
, sp_Layout_MenuHeight
, sp_Layout_PostMenuHeight
, (sp_Layout_ContentHeightMode.ToLower() == "min-height" ? "min-height" : "height")
, sp_Layout_ContentHeight
, sp_Layout_ContentBodyPaddingTop
, sp_Layout_ContentBodyPaddingRight
, sp_Layout_ContentBodyPaddingBottom
, sp_Layout_ContentBodyPaddingLeft
, sp_Layout_FooterHeight
, sp_Layout_MainContainerWidth - sp_Layout_ContentBodyPaddingLeft - sp_Layout_ContentBodyPaddingRight
);


    string resizableBlocAdminAttributes_PreMenu = (!layoutModel._AdminMode ? "class=\"" + (sp_Layout_DisplayPreMenu ? "" : "notDisplayed") + "\"" : "class=\"resizableBlockContainer BGUploadMenu " + (sp_Layout_DisplayPreMenu ? "" : "notDisplayed") + "\" data-resize_axis=\"xy\" data-x_impact=\"$.fn.AdminSettingsLayoutResize('x','#MyPrettyCMSPreMenu')\" data-y_impact=\"$.fn.AdminSettingsLayoutResize('y','#MyPrettyCMSPreMenu')\"");
    string resizableBlocAdminAttributes_Menu = (!layoutModel._AdminMode ? "class=\"" + (sp_Layout_DisplayMenu ? "" : "notDisplayed") + "\"" : "class=\"resizableBlockContainer BGUpload " + (sp_Layout_DisplayMenu ? "" : "notDisplayed") + "\" data-resize_axis=\"xy\" data-x_impact=\"$.fn.AdminSettingsLayoutResize('x','#MyPrettyCMSMenu')\" data-y_impact=\"$.fn.AdminSettingsLayoutResize('y','#MyPrettyCMSMenu')\"");
    string resizableBlocAdminAttributes_PostMenu = (!layoutModel._AdminMode ? "class=\"" + (sp_Layout_DisplayPostMenu ? "" : "notDisplayed") + "\"" : "class=\"resizableBlockContainer BGUpload " + (sp_Layout_DisplayPostMenu ? "" : "notDisplayed") + "\" data-resize_axis=\"xy\" data-x_impact=\"$.fn.AdminSettingsLayoutResize('x','#MyPrettyCMSPostMenu')\" data-y_impact=\"$.fn.AdminSettingsLayoutResize('y','#MyPrettyCMSPostMenu')\"");
    string resizableBlocAdminAttributes_MyPrettyCMSContent = (!layoutModel._AdminMode ? "" : " class=\"resizableBlockContainer BGUpload\" data-resize_axis=\"xy\" data-x_impact=\"$.fn.AdminSettingsLayoutResize('x','#MyPrettyCMSContent')\" data-y_impact=\"$.fn.AdminSettingsLayoutResize('y','#MyPrettyCMSContent')\"");
    string resizableBlocAdminAttributes_Footer = (!layoutModel._AdminMode ? "class=\"" + (sp_Layout_DisplayFooter ? "" : "notDisplayed") + "\"" : "class=\"resizableBlockContainer BGUpload " + (sp_Layout_DisplayFooter ? "" : "notDisplayed") + "\" data-resize_axis=\"xy\" data-x_impact=\"$.fn.AdminSettingsLayoutResize('x','#MyPrettyCMSFooter')\" data-y_impact=\"$.fn.AdminSettingsLayoutResize('y','#MyPrettyCMSFooter')\"");
    
}
@section HeadLocalCSS {
    <link href="/Content/ViewsLayout/LayoutSiteMenuTop.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/ViewsLayout/LayoutSiteMenuTop.js"></script>
    <style type="text/css" id="StyleContentWrapper">
        @cssResizableBlocks
    </style>
    @if (IsSectionDefined("HeadLocalCSS"))
    {
        @RenderSection("HeadLocalCSS")
    }
    <script type="text/javascript">
        var sp_ContentHeight = @sp_Layout_ContentHeight;
        var sp_ContentRealHeight = @sp_Layout_ContentRealHeight;
        var sp_ContentHeightMode = '@sp_Layout_ContentHeightMode';
        $.fn.SiteLayoutPrepareMenu = function () {
            var menuMode = "kendoMenu";
            menuMode = "kendoMenu";
            switch (menuMode) {
                case "kendoMenu":
                    $("#layoutMenu").kendoMenu({
                        open: $.fn.KendoMenuOpenFixup
                    });
                    break;
                    //case "kendoPanelBar": LJO: ToDo
                    //    $("#layoutMenu").kendoPanelBar({
                    //        expandMode: "single"
                    //    });
                    //    break;
                    //case "kendoTreeView": LJO: ToDo
                    //    $("#layoutMenu").kendoTreeView({
                    //    });
                    //    break;
            }
            $("#layoutMenu").removeClass("notDisplayed");
        }
    </script>
}
<div class="myprettycms wholePage @adminModeCSSClass LayoutSiteMenuLeft BGUpload">
    <div class="myprettycms content-wrapper BGUpload ">
        <div class="float-left">
            <section id="LanguageSelector">
                @Html.Partial("_LanguageSelector", layoutModel._Languages)
            </section>
        </div>
        <div class="float-right">
            <section id="login">
                @Html.Partial("_LoginPartial", layoutModel._Languages.SelectedLanguage)
            </section>
        </div>
        <div class="myprettycms premenucontent content-wrapper BGUpload">
        </div>
    </div>
    <div id="MyPrettyCMSMainContainer">
        <div id="MyPrettyCMSPreMenu" @Html.Raw(resizableBlocAdminAttributes_PreMenu)></div>
        <div id="MyPrettyCMSMenu" @Html.Raw(resizableBlocAdminAttributes_Menu)>
            @if (layoutModel._DisplayMenus)
            { 
                <nav>
                    <div id="divMenuBar">
                        @Html.Partial("_MenuBar", layoutModel._Menus)
                    </div>
                    <div class="layoutMenuCache">
                    </div>
                </nav>
            }
        </div>
        <div id="MyPrettyCMSPostMenu" @Html.Raw(resizableBlocAdminAttributes_PostMenu)></div>
        <div id="MyPrettyCMSContent" @Html.Raw(resizableBlocAdminAttributes_MyPrettyCMSContent)>
            @RenderBody()
        </div>
        <div id="MyPrettyCMSFooter" @Html.Raw(resizableBlocAdminAttributes_Footer)></div>
    </div>
</div>
@section SiteFooter{
    <footer>
        <div class="FooterCopyright">
            <a href="http://www.innovacall.com">&copy; INNOVACALL 2012</a>
        </div>
        <div class="FooterLogoMyPrettyCMS">
            <a href="http://www.innovacall.com" target="_blank">
                <img src="/Images/LogoInnovacallMyPrettyCMS.png" alt="Done with Innovacall My Pretty CMS" />
            </a>
        </div>
    </footer>
}